﻿@model AceMobile.Models.Phones.Phone

@{
    ViewBag.Title = "Create";
    AceMobile.Models.MobileWebContext context = new AceMobile.Models.MobileWebContext();
    List<AceMobile.Models.Phones.PhoneProducer> listProducer = context.PhoneProducers.ToList();
    List<AceMobile.Models.Phones.PhoneOS> listOS = context.PhoneOSs.ToList();
}

<h2>Tạo mới loại sản phẩm</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Điện thoại</legend>
        <br />
        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Size)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Size)
            @Html.ValidationMessageFor(model => model.Size)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Price)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Price)
            @Html.ValidationMessageFor(model => model.Price)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ConciseFeature)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ConciseFeature)
            @Html.ValidationMessageFor(model => model.ConciseFeature)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DetailFeature)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DetailFeature)
            @Html.ValidationMessageFor(model => model.DetailFeature)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ImageUrl)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ImageUrl)
            @Html.ValidationMessageFor(model => model.ImageUrl)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ManufacturingDate)
        </div>
        <div class="editor-field">
                    
            @Html.TextBoxFor(model => model.ManufacturingDate, new { id = "datepicker"})
            @Html.ValidationMessageFor(model => model.ManufacturingDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.MadeIn)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.MadeIn)
            @Html.ValidationMessageFor(model => model.MadeIn)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.SumAmount)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SumAmount)
            @Html.ValidationMessageFor(model => model.SumAmount)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.PhoneProducer.Name)
        </div>
        <div class="editor-field" style="width: 100px;">
            @Html.DropDownList("Producer", new SelectList(listProducer, "ID", "Name"))
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.PhoneOS.Name)
        </div>
        <div class="editor-field" style="width: 100px;">
            @Html.DropDownList("OS", new SelectList(listOS, "ID", "Name"))
        </div>
        <p>
            <input type="submit" value="Tạo sản phẩm" />
        </p>
    </fieldset>
}
<br />
<div>
    @Html.ActionLink("Quay trở lại", "Index")
</div>
